/*
 * Copyright (c) 2006, 2021, webrx.cn All rights reserved.
 *
 */
package cn.webrx;

import java.util.*;

/**
 * <p>Project: javase - BookInfo
 * <p>Powered by webrx On 2021-12-10 16:01:04
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
public class BookInfo {
    public static void main(String[] args) {


        Map<String, String> map = new HashMap<String, String>();
        map.put("d", "ddd");
        map.put("b", "bbb");
        map.put("a", "aaa");
        map.put("c", "ccc");
        Iterator<String> iterator = map.keySet().iterator();
        while (iterator.hasNext()) {
            String key = iterator.next();
            System.out.println("map.get(key) is :" + map.get(key));
        }
    }

    public static void acff() {
        Map<String, Integer> tm = new TreeMap<>();
        tm.put("java", 100);
        tm.put("php", 10);
        tm.put("c", 90);
        tm.put("python", 70);
        tm.put("go", 30);
        tm.put("ruby", 15);
        tm.put("c++", 150);
        System.out.println(tm);
        System.out.println(tm.keySet());
        System.out.println(tm.values());
    }

    public static void test(String[] args) {
        Map<Integer, String> map = new TreeMap<>((a, b) -> b - a);
        map.put(10, "java");
        map.put(5000, "ja");
        map.put(1, "javase");
        map.put(300, "javacript");
        System.out.println(map);

        TreeMap<Integer, String> map1 = new TreeMap<>();
        map1.put(10, "java");
        map1.put(5, "ja");
        map1.put(1, "javase");
        map1.put(105, "javacript");
        System.out.println(map1);

        System.out.println(("1").hashCode());
        System.out.println(("2").hashCode());
        System.out.println(("3").hashCode());
    }
}
